<?php
/* Load the class */
require_once('DropboxClient.php');
/* Create new instance with your consumer token and secret */
$dc=new DropboxClient("your_consumer_token","your_consumer_secret");
/*
 If there isn't a oauth_token variable authorize
 else get the access token
*/
if(empty($_REQUEST['oauth_token'])){
    /* Start the authentication
      this will redirect the user to the Dropbox website
      and then back here.
      $dc->authorize(callback_url)
    */
    $dc->authorize('http://'.$_SERVER['SERVER_NAME'].'/'.$_SERVER['REQUEST_URI']);
}else{
    /*
     Gets the access token
    */
    $token=$dc->accessToken($_REQUEST['oauth_token']);
    /*
    Now you can save the access token
    $token is an array with two elements 'token' and 'secret'
    */
}
?>